<?php
header("Content-Type: text/html;charset=utf-8"); 
require_once ('../Config/conn.php"');



  $title = isset($_POST['title']) ? $_POST['title'] : '';
  $content = isset($_POST['content']) ? $_POST['content'] : '';
  $author = 'admin';
  $time = time();
  $hot = '100';
  $summary =isset($_POST['content']) ? $_POST['content'] : '';



 if($title == '' || $content == ''){
	   echo "你还没有填写数据！";
	   echo '<script>setTimeout(\'location="index.php"\', 3000);</script>';
	
	 exit;
	 
	 }else{
		 
     $datas = $db->insert("article",  array(
		  "title" => $title,
		  "content" => $content,
		  "author" => $author,
		  "time" => $time,
		  "hot" => $hot,
		  "summary" => $summary
      ));

		echo "提交成功：）";
		echo '<script>setTimeout(\'location="index.php"\', 3000);</script>';
		
	  exit;
		 }
?>